#pragma once
#include "includes.h"
template <class T>

class vector2
{
public:
    T x,y;
    vector2<T>(T _x, T _y){
        x=_x;
        y=_y;
    }
    vector2<T>(){}
    vector2<T>(const vector2<T>& v){
        x=v.x;
        y=v.y;
    }

    //implicit inline
    float mag(){ return sqrt((float)(x*x+y*y)); }
    T magsqr(){ return x*x+y*y; }
    vector2<T> operator+ (vector2<T> v){ return vector2<T>(x+v.x,y+v.y); }
    vector2<T> operator- (vector2<T> v){ return vector2<T>(x-v.x,y-v.y); }
    vector2<T> operator- (){ return vector2<T>(-x,-y); }
    bool operator== (vector2<T> v){ return (x==v.x && y==v.y); }
    bool includes(T a) {return (a==x || a == y);}
};
